package com.own.core.html.form.textField;

import org.apache.wicket.model.IModel;

import com.own.core.html.OwnPatternValidator;

public class OwnTextField extends org.apache.wicket.markup.html.form.TextField {

	TextField textfield;

	public OwnTextField(String id) {
		super(id);
		init();
	}

	public OwnTextField(final String id, final IModel model) {
		super(id, model);
		init();

	}

	/**
	 * @param id
	 * @param model
	 * @see org.apache.wicket.Component#Component(String, IModel)
	 */
	public OwnTextField(final String id, final IModel model, TextField textfield) {
		super(id, model);
		this.textfield = textfield;
		if (!textfield.number()) {
			this.add(new OwnPatternValidator(textfield.validate()));
		}
		init();
	}

	public void init() {

		setOutputMarkupId(true);
		setOutputMarkupPlaceholderTag(true);

	}

}
